﻿<phone:PhoneApplicationPage 
    x:Class="WP7Guide.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" >
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="TwoLinesItemTemplate">
            <StackPanel Margin="0,0,0,17" Width="432" Height="78">
                <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                <TextBlock Text="{Binding Details}" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                <!--<TextBlock Text="{Binding LineThree}" Style="{StaticResource PhoneTextSubtleStyle}"/>-->
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="TimerItemTemplate">
            <StackPanel Margin="0,0,0,17" Width="432" Height="105">
                <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                <TextBlock Text="{Binding ServiceName}" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}">
                	<TextBlock.Foreground>
                		<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
                	</TextBlock.Foreground>
                </TextBlock>
                <TextBlock Text="{Binding Time}" Style="{StaticResource PhoneTextSubtleStyle}"/>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <StackPanel x:Name="LayoutRoot">
        <!--<Button Click="Button_Click">
            <TextBlock>Test5</TextBlock>
        </Button>-->
        <ProgressBar IsIndeterminate="True" Visibility="{Binding ProgressVisible}"/>
        <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid  Background="Transparent">
 
        <!--Panorama control-->
        <controls:Panorama Title="{Binding Resources.AppName, Source={StaticResource Localize}}" Name="PanoramaTV">
            <controls:Panorama.Background>
                <ImageBrush ImageSource="PanoramaBackground.jpg"/>
            </controls:Panorama.Background>

                <controls:PanoramaItem  Header="{Binding Resources.BouquetsCaption, Source={StaticResource Localize}}">
                    <ListBox Margin="0,0,-12,0" Name="listOne" SelectionChanged="listOne_SelectionChanged" 
                         ItemTemplate="{StaticResource TwoLinesItemTemplate}" SelectionMode="Single" 
                         ItemsSource="{Binding Bouquets}" />
            </controls:PanoramaItem>

                <controls:PanoramaItem Header="{Binding Resources.TimerCaption, Source={StaticResource Localize}}">
                    <ListBox Name="ListTwo" ItemTemplate="{StaticResource TimerItemTemplate}" 
                         Margin="0,0,-12,0" 
                         ItemsSource="{Binding Timer}" />
            </controls:PanoramaItem>

                <controls:PanoramaItem Header="{Binding Resources.SettingsCaption, Source={StaticResource Localize}}">
                    <StackPanel Name="SettingsPanel" Margin="0,0,-12,0">
                        <TextBlock Text="{Binding Resources.DreamboxHost, Source={StaticResource Localize}}"></TextBlock>
                        <TextBox InputScope="Url" Text="{Binding DreamboxHost, Mode=TwoWay}"></TextBox>
                        <TextBlock Text="{Binding Resources.MaxBouquets, Source={StaticResource Localize}}"></TextBlock>
                        <TextBox InputScope="Number" Text="{Binding MaxBouquets, Mode=TwoWay}"></TextBox>
                        <TextBlock Text="{Binding Resources.MaxDays, Source={StaticResource Localize}}"></TextBlock>
                        <TextBox LostFocus="MaxDaysBox_LostFocus" InputScope="Number" Name="MaxDaysBox" TextChanged="TextBox_TextChanged" Text="{Binding DaysToLoad, Mode=TwoWay}"></TextBox>
                        <Button Click="Reload_Click">
                            <TextBlock Text="{Binding Resources.Reload, Source={StaticResource Localize}}"></TextBlock>
                        </Button>
                    </StackPanel>
            </controls:PanoramaItem>         
            <controls:PanoramaItem Header="{Binding Resources.About, Source={StaticResource Localize}}">
                    <StackPanel Margin="0,0,-12,0">
                        <TextBlock  Style="{StaticResource PhoneTextExtraLargeStyle}">Dreambox TV Guide</TextBlock>
                        <TextBlock   TextWrapping="Wrap" Text="{Binding Resources.AboutText, Source={StaticResource Localize}}"></TextBlock>
                        <HyperlinkButton Content="wp7guide@live.de" Click="HyperlinkButton_Click">
                        	<HyperlinkButton.Foreground>
                        		<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
                        	</HyperlinkButton.Foreground>
                        </HyperlinkButton>
                    </StackPanel>
            </controls:PanoramaItem>       

            <!--<controls:PanoramaItem Header="Aufnahmen" Name="EventsPan">
                <ListBox Margin="0,0,-12,0" Name="ListThree" ItemTemplate="{StaticResource ThreeLinesItemTemplate}" ItemsSource="{Binding ElementName=ListTwo, Path=SelectedItem.SubItems}" SelectionChanged="ListThree_SelectionChanged">
                </ListBox>
            </controls:PanoramaItem>     -->   
        </controls:Panorama>
    </Grid>
    </StackPanel>
    <!--Panorama-based applications should not show an ApplicationBar-->


</phone:PhoneApplicationPage>
    